package com.mangatta.ec2.util;

import java.util.Collection;
import java.util.Iterator;

public class StringHelper {
    public static String join(Collection<String> s, String delimiter) {
        StringBuilder buffer = new StringBuilder();
        Iterator<String> iterator = s.iterator();
        if (iterator.hasNext()) {
            buffer.append(iterator.next());
            while (iterator.hasNext()) {
                buffer.append(delimiter);
                buffer.append(iterator.next());
            }
        }
        return buffer.toString();
    }
}
